<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>课程信息管理</title>
	<meta name="decorator" content="default" />
	<script type="text/javascript">
		/*页面 初始化时候做的事情*/
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<shiro:hasPermission name="business:course:view">
	<li class="active"><a href="${ctx}/business/course/">课程信息列表</a></li>
	</shiro:hasPermission>
	<shiro:hasPermission name="business:course:edit">
		<li><a href="${ctx}/business/course/form?sort=10">课程信息添加</a></li>
	</shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="course"
		   action="${ctx}/business/course/" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
	<input id="pageSize" name="pageSize" type="hidden"
		   value="${page.pageSize}" />
	<label>名称  ：</label>
	<form:input path="title" value="${title}" htmlEscape="false" maxlength="50"
				class="input-medium"  />

	<label>是否免费  ：</label>
	<form:select path="free" name="free" id="free">
		<form:option value="" label="请选择" />
		<form:options items="${dic:getBusDictList( 'course_if_free')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
	</form:select>
	&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit"
	value="查询" />

</form:form>
<tags:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>

			<th>课程序号</th>
			<th>课程名称</th>
			<th>课程封面</th>
			<th>购买人数</th>
			<th>是否免费</th>
			<th>课程原价</th>
			<th>课程现价</th>
			<th>观看人数</th>
			<th>主讲老师</th>
			<th>创建人</th>
			<th>创建日期</th>
			<th>修改人</th>
			<th>更新日期</th>
			<th>备注</th>
		<shiro:hasPermission name="business:course:edit">
			<th>操作</th>
		</shiro:hasPermission>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="course">
		<tr>


					<td>${course.seq}</td>
					<td>${course.title}</td>
					<td>
						<img style="width: 100px" src="${course.cover}?x-oss-process=style/list">
					</td>
					<td>${course.buyCount}</td>
					<td>${dic:getLabelByValue(course.free, 'course_if_free')}</td>
					<td>${course.originalPrice}</td>
					<td>${course.presentPrice}</td>
					<td>${course.viewCount}</td>
					<td>${course.teacher.name}</td>
					<td>${course.createBy}</td>
					<td>${course.createDate}</td>
					<td>${course.updateBy}</td>
					<td>${course.updateDate}</td>
					<td>${course.remarks}</td>
					<td>
					<shiro:hasPermission name="business:course:edit">
						<a href="${ctx}/business/course/form?id=${course.id}">修改</a>
					</shiro:hasPermission>
					<shiro:hasPermission name="business:course:delete">
					<a href="${ctx}/business/course/delete?id=${course.id}"
					   onclick="return confirmx('确认要删除该字典吗？', this.href)">删除</a>
					</shiro:hasPermission>
					<shiro:hasPermission name="business:course:addevent">
						<a href="${ctx}/business/course/addevent?id=${course.id}">添加任务</a>
					</shiro:hasPermission>
					<shiro:hasPermission name="business:course:addevent">
							<a href="${ctx}/business/course/begin?id=${course.id}">开始上课</a>
					</shiro:hasPermission>
				</td>

		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>